function initTable(){
	queryOrdersAjax.send();
}
var btnEvent = {
		search:function(){
			orderPagination.resetPagination();
			queryOrdersAjax.send();
		},
		frmResetData:function(){
			$('#orderFrm')[0].reset();
		},
		exportExcel:function(){
			MsgBox.confirm("确认条件导出excel？", "提示", function(){
				var data = $('#orderFrm').serializeObject();
				$.download({
					'type':'post',
					'data':data,
					'url':ctx+"/yzj/orderManage/excel"
				});
			})
		}
}

var tableEvent = {
		renderItem:function(colName,text,indexStr,mItem){
			switch(colName){
			case 'operate':
				var html = '<span title="查看明细" style="margin-right:0.5em"><a href="javascript:void(0)" class="detailABtn">'
					+'<i class="icon icon-eye-open icon18"></i>'+
					'</a></span>'+
					'<span title="分期还款记录"><a href="javascript:void(0)" class="repayRecord">'+
					'<i class="icon icon-file-text-o icon18"></i>'+
					'</a></span>';
				return html;
			case 'orderState':
				return $('#StatesSelMM').find('option[value="'+text+'"]').text();
			}
		},
		afterReady:function(){
			$('.detailABtn').click(function(e){
				e.stopPropagation();
				e.preventDefault();
				var num = $(this).parents('tr').index();
				var record = orderTable.records[num].data;
				var url = ctx + "/yzj/orderManage/detail/"+record.orderId;
				MsgBox.open("orderDetail", "订单详情", url, "1000px");
			});
			$('.repayRecord').click(function(e){
				e.stopPropagation();
				e.preventDefault();
				var num = $(this).parents('tr').index();
				var record = orderTable.records[num].data;
				var url = ctx + "/yzj/orderManage/repayRecord/"+record.orderId;
				MsgBox.open("repayRecord", "还款记录", url, "1300px");
			});
		}
}

function refreshT(){
	queryOrdersAjax.send();
}
